package com.gpj.learn.springmvc.gpjmvc.controller;

import com.gpj.learn.springmvc.gpjmvc.annotations.Controller;
import com.gpj.learn.springmvc.gpjmvc.annotations.RequestMapping;
import com.gpj.learn.springmvc.gpjmvc.annotations.ResponseBody;
import com.gpj.learn.springmvc.gpjmvc.entity.UserEntity;
import lombok.extern.slf4j.Slf4j;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @className TestController
 * @description
 *   TODO
 * @author GPJ
 * @date 2021/8/18 15:28
 * @version 1.0
 **/
@Slf4j
@Controller
@RequestMapping("/gpj")
public class TestController {

	@RequestMapping("/simple.do")
	@ResponseBody
	public Object simple(HttpServletRequest request, HttpServletResponse response) {
		return  "simple";
	}

	@RequestMapping("/test.do")
	@ResponseBody
	public Object test(String name, HttpServletRequest request, HttpServletResponse response, UserEntity userEntity) {
		request.getParameter("name");
		log.info("{}", name);
		log.info("{}", request);
		log.info("{}", response);
		log.info("{}", userEntity);
		return  "test";

	}

	@RequestMapping("/model.do")
	public Object model() {
		return "index";
	}
}
